import { Toast } from 'vant';
import store from 'store';

export default {
	state: {
		list: store.get('tabbar') || []
	},

	actions: {
		tabbarLoad({ commit }) {
			return this.service.bwbt.bwbtNav.list({ type: 1 }).then(res => {
				commit('SET_TABBAR', res);
				return res;
			});
		}
	},

	mutations: {
		SET_TABBAR(state, value) {
			state.list = value;
			store.set('tabbar', value);
		},

		CLEAR_TABBAR(state) {
			state.list = [];
		}
	}
};
